package com.example.springBoot.service;

import com.example.springBoot.controller.GirlRepository;
import com.example.springBoot.domain.Girl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author chenpeng
 * @date 2018/4/19 13:23
 */
@Service
public class GirlService {
    @Autowired
    private GirlRepository girlRepository;
    @Transactional
    public void insertTwo(){
        Girl girlA = new Girl();
        girlA.setCupSize("A");
        girlA.setAge(22);
        girlRepository.save(girlA);


        Girl girlB = new Girl();
        girlB.setCupSize("BB");
        girlB.setAge(24);
        girlRepository.save(girlB);
    }
}
